home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 February
/
EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso
/
earcd
/
comm2
/
termsorc.lha
/
Extras
/
Source
/
gtlayout-source.lha
/
LT_GetCode.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-09-24
|
818b
|
36 lines
/* GadTools layout toolkit
**
** Copyright © 1993-1995 by Olaf `Olsen' Barthel
** Freely distributable.
*/
#include "gtlayout_global.h"
WORD LIBENT
LT_GetCode(REG(d0) ULONG MsgQualifier,REG(d1) ULONG MsgClass,REG(d2) UWORD MsgCode,REG(a0) struct Gadget *MsgGadget)
{
if(MsgClass == IDCMP_RAWKEY && !(MsgCode & IECODE_UP_PREFIX) && KeymapBase)
{
UBYTE Buffer[10];
struct InputEvent Event;
LONG Len;
Event . ie_NextEvent = NULL;
Event . ie_Code = MsgCode & ~IECODE_UP_PREFIX;
Event . ie_Qualifier = MsgQualifier;
Event . ie_Class = IECLASS_RAWKEY;
Event . ie_SubClass = 0;
Event . ie_position . ie_addr = (APTR)MsgGadget;
Buffer[0] = 0;
if((Len = MapRawKey(&Event,Buffer,9,NULL)) > 0)
{
if(Buffer[0] != 0x9B || Len == 1)
return((WORD)Buffer[0]);
}
}
return(-1);
}